//
//  UIView+Category.h
//  lc-collect
//
//  Created by mac on 2021/3/4.
//

#import <UIKit/UIKit.h>

typedef void(^TouchCallBackBlock)(void);

NS_ASSUME_NONNULL_BEGIN

@interface UIView (Category)

@property (nonatomic, copy) TouchCallBackBlock touchCallBackBlock;

#pragma mark - view 添加点击响应

- (void)lc_addActionWithblock:(TouchCallBackBlock)block;
- (void)lc_addTarget:(id)target action:(SEL)action;

#pragma mark - other

/// @brief  找到当前view所在的viewcontroler
@property (readonly) UIViewController *viewController;

/// 查找第一响应者
- (UIView *)firstResponderView;

/// 把View加在Window上
- (void)addToWindow;

/// 移除所有子视图
- (void)removeAllSubviews;

@end

NS_ASSUME_NONNULL_END
